Before
you can access external databases from AutoCAD®,
you must configure them using the Microsoft® external
ODBC and OLE DB programs.
NoteThe 64-bit release
of AutoCAD does not support the use of Microsoft Jet 4.0 OLE
DB Provider (for MDB connectivity) and Microsoft OLE DB Provider for
ODBC Drivers (for XLS connectivity). For more information, see Substituting the
use of SQL Server instead of OLE DB with DbConnect.
Once you have configured your databases, you
can access their data from AutoCAD, even if you don't have the
database system that created the data installed on your system. AutoCAD can
access data from the following applications:
- Microsoft Access
- dBase
- Microsoft Excel
- Oracle
- Paradox
- Microsoft Visual FoxPro®
- SQL Server
NoteWith MDAC versions
2.1 and higher, you can't edit dBase files unless you have a Borland
DataBase Engine (BDE) installed on your computer.
Once you have successfully configured a database
to use with AutoCAD, a configuration file with the extension
UDL is created. This configuration file contains the information AutoCAD needs
to access the configured database. By default, UDL files are stored
in the Data Links folder of AutoCAD. You
can specify a different location for UDL files from the Options
dialog box.
The following topics demonstrate how to set
up a data source using ODBC, and how to configure data sources so
that you can use them with AutoCAD. For detailed information
about ODBC and OLE DB, refer to the following online Microsoft resources:
- OLE DB Help
- ODBC Help
- ODBC Microsoft Desktop Database Drivers
Bypass ODBC Using an OLE
DB Direct Driver
Several database management systems supported
by AutoCAD have direct drivers available for OLE DB. If you use
these direct drivers, you don't need to set up configuration files
from within both ODBC and OLE DB; you only need a single OLE DB
configuration file.
Direct database drivers are available for the
following database systems:
- Microsoft Access
- Oracle
- Microsoft SQL Server
Use ODBC to Create a Configuration
File
ODBC
is an intermediary program that makes data from one application available
to other applications.
Configure a Data Source
with OLE DB
You can use OLE DB to establish
a UDL configuration file that points to an external database table.
Substituting SQL Server
for OLE DB
If
you are using the 64-bit release of AutoCAD and DbConnect with
a connection that accesses a Microsoft Access database or a Microsoft
Excel spreadsheet using one of the two following methods, you need
to change your connections to use Microsoft SQL Server. Microsoft
does not supporting a 64-bit version of these technologies.
- Microsoft Jet 4.0 OLE DB Provider (for
MDB connectivity)
- Microsoft OLE DB Provider for ODBC Drivers
(for XLS connectivity)
Microsoft
SQL Server comes in three different editions. If you are accessing data
from an MDB or XLS file today, you might find that using Microsoft
SQL Server Express Edition is adequate for your needs. Microsoft
also offers Standard and Enterprise editions of SQL Server. For
additional information about SQL Server, visit Microsoft’s website
at http://www.microsoft.com/sql.
NoteYou
can purchase inexpensive third-party utilities to help automate
the conversion of data stored in a MDB to a MDF file that can be
used with SQL Server. Many of these utilities also allow you to
export data from a MDF to a MDB file.
To specify a new location
for UDL files
- .
- In the Options dialog box, Files tab,
select Data Source Location, and then click Browse.
- In the Browse for Folder dialog box,
locate and select the folder you want. Click OK.
- Click OK.
To set up a direct Microsoft
Access configuration using OLE DB
- At the Configure a Data Source prompt,
select from the possible data sources you would like to use.
- In the Data Link Properties dialog box,
the Provider tab, select Microsoft Jet 4.0 OLE DB Provider. Click
Next.
- In Select or Enter a Database Name, enter
the name and path to the database you want to configure.
- Click Test Connection to verify that
your configuration is working properly.
If the connection fails, verify that the settings
are correct. For example, spelling errors and case sensitivity may
be the cause of a failed connection.
- In the Microsoft Data Link dialog box,
click OK.
- Click OK.
To set up a direct Oracle
configuration using OLE DB
- In the Data Link Properties dialog box,
the Provider tab, select Microsoft OLE DB Provider for Oracle. Click
Next.
- Enter the Oracle server name in Enter
a Server Name.
- Enter a valid user name and password.
- Click Test Connection to verify that
the settings are correct. For example, spelling errors and case
sensitivity may be the cause of a failed connection.
- In the Microsoft Data Link dialog box,
click OK.
- Click OK.
To set up a direct SQL
Server configuration using OLE DB
- In the Data Link Properties dialog box,
the Provider tab, select Microsoft OLE DB Provider for SQL Server.
Click Next.
- Enter the server name in Select or Enter
a Server Name.
- Enter a valid user name and password.
- Select the database to configure in Select
the Database on the Server.
- Click Test Connection to verify that
the settings are correct. For example, spelling errors and case
sensitivity may be the cause of a failed connection.
- In the Microsoft Data Link dialog box,
click OK.
- Click OK.
To set up a Microsoft Access
data source using ODBC
- Click Start menu (Windows)
Settings
Control
Panel.
- Double-click the ODBC icon.
- In the ODBC Data Source Administrator
dialog box, do one of the following:
- Choose the User DSN tab to create a data
source that is visible only to you and can be used only on the computer
you create it in.
- Choose the System DSN tab to create a
data source that is visible to all users who have access rights
to the computer.
- Choose the File DSN tab to create a data
source that can be shared with other users who have the same ODBC
drivers installed on their systems.
- Click Add.
- Select the Microsoft Access Driver, and
then click Finish.
- Enter a name for your data source in
Data Source Name.
- Click Select, and then locate and select
the database that you want to configure. Click OK.
- In the ODBC Microsoft Access dialog box,
click OK.
- In the ODBC Data Source Administrator
dialog box, click OK.
To set up a dBase data
source using ODBC
- Click Start menu (Windows)
Settings
Control
Panel.
- Double-click the ODBC icon.
- In the ODBC Data Source Administrator
dialog box, do one of the following:
- Choose the User DSN tab to create a data
source that is visible only to you and can be used only on the computer
you create it in.
- Choose the System DSN tab to create a
data source that is visible to all users who have access rights
to the computer.
- Choose the File DSN tab to create a data
source that can be shared with other users who have the same ODBC
drivers installed on their systems.
- Click Add.
- Select the Microsoft dBase Driver, and
then click Finish.
- Enter a name for your data source in
Data Source Name, and select the appropriate version of dBase from
the Version list.
- Make sure that Use Current Directory
is cleared.
- Click Select Directory, and then locate
and select the directory that contains the database tables you want
to configure. Click OK.
- In the ODBC dBase Setup dialog box, click
OK.
- In the ODBC Data Source Administrator
dialog box, click OK.
To set up a Microsoft Excel
spreadsheet to use with
- In Microsoft Excel, open the workbook
or spreadsheet that you want to access from AutoCAD.
- Select a range of cells to function as
a database table.
- Enter a name for the range of cells in
the Name Box, then press ENTER.
- Repeat steps 2 and 3, if desired, to
specify additional database tables.
NoteMicrosoft Excel is
not a true database management system. In order to access Excel
data from within AutoCAD, you must first specify at least one named
range of Excel cells to function as a database table. Each named
range of cells that you specify within a spreadsheet is treated
as an individual table by AutoCAD.
To set up a Microsoft Excel
data source using ODBC
- Click Start menu (Windows)
Settings
Control
Panel.
- Double-click the ODBC icon.
- In the ODBC Data Source Administrator
dialog box, do one of the following:
- Choose the User DSN tab to create a data
source that is visible only to you and can be used only on the computer
you create it in.
- Choose the System DSN tab to create a
data source that is visible to all users who have access rights
to the computer.
- Choose the File DSN tab to create a data
source that can be shared with other users who have the same ODBC
drivers installed on their systems.
- Click Add.
- Select the Microsoft Excel Driver, and
then click Finish.
- Enter a name for your data source in
Data Source Name, and select the appropriate version of Excel from
the Version list.
- Make sure that Use Current Directory
is cleared.
- Click Select Workbook, and then locate
and select the workbook or spreadsheet you want to configure. Click
OK.
- In the ODBC Microsoft Excel dialog box,
click OK.
- In the ODBC Data Source Administrator
dialog box, click OK.
To set up an Oracle data
source using ODBC
- Click Start menu (Windows)
Settings
Control
Panel.
- Double-click the ODBC icon.
- In the ODBC Data Source Administrator
dialog box, do one of the following:
- Choose the User DSN tab to create a data
source that is visible only to you and can be used only on the computer
you create it in.
- Choose the System DSN tab to create a
data source that is visible to all users who have access rights
to the computer.
- Choose the File DSN tab to create a data
source that can be shared with other users who have the same ODBC
drivers installed on their systems.
- Click Add.
- Select Microsoft ODBC for Oracle, and
then click Finish.
- Enter a name for your data source in
Data Source Name.
- Enter your user name.
- Enter the name of the Oracle Server in
Server.
- Click OK.
- In the ODBC Data Source Administrator
dialog box, click OK.
To set up a Paradox data
source using ODBC
- Click Start menu (Windows)
Settings
Control
Panel.
- Double-click the ODBC icon.
- In the ODBC Data Source Administrator
dialog box, do one of the following:
- Choose the User DSN tab to create a data
source that is visible only to you and can be used only on the computer
you create it in.
- Choose the System DSN tab to create a
data source that is visible to all users who have access rights
to the computer.
- Choose the File DSN tab to create a data
source that can be shared with other users who have the same ODBC
drivers installed on their systems.
- Click Add.
- Select the Paradox Driver, and then click
Finish.
- Enter a name for your data source in
Data Source Name, and select the appropriate version of Paradox
from the Version list.
- Make sure that User Current Directory
is cleared.
- Click Select Directory, and then locate
and select the database you want to configure. Click OK.
- In the ODBC Paradox Setup dialog box,
click OK.
- In the ODBC Data Source Administrator
dialog box, click OK.
To configure a data source
using OLE DB
You can use OLE DB to
establish a UDL configuration file that points to an external database
table.
- Use Microsoft ODBC to set up a data source
(see Use ODBC to Create a Configuration File).
- In the Data Link Properties dialog box,
the Provider tab, select Microsoft OLE DB Provider for ODBC Drivers.
Choose Next.
- Enter the name of the data source you
want to configure in Use Data Source Name.
- Click Test Connection to verify that
your configuration is working properly.
If the connection fails, verify that the settings
are correct. For example, spelling errors and case sensitivity may
be the cause of a failed connection.
- In the Microsoft Data Link dialog box,
click OK.
- Click OK.
Commands